﻿Imports DevExpress.XtraBars
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo

Public Class UCMantUsuario

    Private Sub UCMantUsuario_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        PopupMenu1.ItemLinks.Add(New BarButtonItem(BarManager1, "Restablecer contraseña"))
        PopupMenu1.ItemLinks.Add(New BarButtonItem(BarManager1, "Deshabilitar usuario"))
        PopupMenu1.ItemLinks.Add(New BarButtonItem(BarManager1, "Habilitar usuario"))

    End Sub

    Private Sub GridView1_PopupMenuShowing(sender As Object, e As DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs) Handles GridView1.PopupMenuShowing
        Dim View As GridView = CType(sender, GridView)
        Dim HitInfo As GridHitInfo = View.CalcHitInfo(e.Point)
        If HitInfo.InRowCell Then
            View.FocusedRowHandle = HitInfo.RowHandle
            PopupMenu1.ShowPopup(BarManager1, View.GridControl.PointToScreen(e.Point))
        End If
    End Sub
End Class
